﻿// -----------------------------------------------------------------------
// <copyright file="Player.cs" company="Diddly Squad">
// </copyright>
// -----------------------------------------------------------------------

using Microsoft.Xna.Framework;

namespace DiddlySquat
{

	/// <summary>
	/// Class that represents player in the game
	/// </summary>
	public class Player : Character
	{

		/// <summary>
		/// Initializes a new instance of the <see cref="Player"/> class.
		/// </summary>
		public Player()
		{
			this.SizeFactor = Constants.PlayerSizeFactor;
			this.MaxJumps = Constants.PlayerMaxJumps;
			this.JumpStrength = Constants.PlayerJumpStrength;
		}

		/// <summary>
		/// Moves the player with specified torque amount.
		/// </summary>
		/// <param name="torqueAmount">The torque amount.</param>
		public void Move(float torqueAmount)
		{
			this.Body.ApplyTorque(torqueAmount);
		}

		/// <summary>
		/// Brakes this instance.
		/// </summary>
		public void Brake()
		{
			this.Body.AngularVelocity = 0;
		}

        protected override Vector2 getExitPosition()
        {
            return this.Position * Constants.MeterInPixels + new Vector2(0, -(this.CharacterExitSprite.Height / 2 - Constants.PlayerRadius));
        }
	}
}
